﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace SYH.Public.BLL
{
    public class Public_MessagesSenders
    {
        public static readonly SYH.Public.DAL.Public_MessagesSenders dal = new DAL.Public_MessagesSenders();

        #region 根据id查找发件
        /// <summary>
        /// 根据id查找发件
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Model.Public_MessagesSenders GetSenderById(string id)
        {

            return dal.GetSenderById(id);
        }
        #endregion

        #region 消息回复
        /// <summary>
        /// 
        /// </summary>
        /// <param name="mailId"></param>
        /// <param name="receiverId"></param>
        /// <param name="senderId"></param>
        /// <param name="contents"></param>
        /// <returns></returns>
        public int ReplyMessage(int mailId, int receiverId, int senderId, string contents)
        {

            return dal.ReplyMessage( mailId,  receiverId,  senderId,  contents); ;
        }
        #endregion

        #region  发件箱
        /// <summary>
        /// 发件箱
        /// </summary>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageCount"></param>
        /// <param name="recordCount"></param>
        /// <param name="sqlWhere"></param>
        /// <returns></returns>
        public static DataTable GetList(int pageSize, int pageIndex, int UserId, out int pageCount, out int recordCount, string sqlWhere)
        {
            return dal.GetList( pageSize,  pageIndex,  UserId, out  pageCount, out  recordCount,  sqlWhere);
        }
        #endregion

        #region  根据mailid查找收件人
        /// <summary>
        /// 根据mailid查找收件人
        /// </summary>
        /// <param name="mailId"></param>
        /// <returns></returns>
        public static DataSet SearchReceivers(int mailId)
        {
            return dal.SearchReceivers(mailId);
        }
        #endregion

        #region  删除
        public int Delete(string idList)
        {

            return dal.Delete(idList); ;
        }
        #endregion

        #region 清空
        /// <summary>
        /// 删除全部发件箱里的东西（就是那个清空按钮）
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public int DeleteAllSendMsg(int userId)
        {
            return dal.DeleteAllSendMsg(userId);
        }
        #endregion

        #region 根据mailids查找发件人们
        /// <summary>
        /// 根据mailid查找发件人们
        /// </summary>
        /// <param name="mailIds"></param>
        /// <returns></returns>
        public static DataSet SearchSenders(string mailIds)
        {
            return dal.SearchSenders(mailIds);
        }
        #endregion
    }
}
